//
//  SAPSellDetailsViewController.m
//  CarsHome
//
//  Created by dapeng on 15/12/5.
//  Copyright © 2015年 dapeng. All rights reserved.
//

#import "SAPSellDetailsViewController.h"

@interface SAPSellDetailsViewController ()

@end

@implementation SAPSellDetailsViewController
- (void)dealloc {
    [_titles release];
    [_picture release];
    [_prices release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
//    self.navigationItem.title = @"综述";
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"xiangqingshoucang1"] style:UIBarButtonItemStyleDone target:self action:@selector(collectPage:)];
    
    NSURL *url = [NSURL URLWithString:_url];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    webView.backgroundColor = [UIColor whiteColor];
    [webView loadRequest:request];
    webView.scalesPageToFit = YES;
    webView.delegate = self;
    [self.view addSubview:webView];
   

}
- (void)collectPage:(UIBarButtonItem *)collect {
    SAKeyValueStore *store = [[SAKeyValueStore alloc] initDBWithName:@"colle.db"];
    NSString *tableName = @"collect_table";
    [store createTableWithName:tableName];
    [store putObject:self.dictionary withId:self.dictionary[@"ids"] intoTable:tableName];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
